package com.bjsxt.livegoods.entity.message;



// 购买商品的消息类型。

import java.util.Objects;

public class LivegoodsBuyMessage extends LivegoodsMessage {
    // 要购买的商品主键
    private String itemId;
    // 购买商品的用户
    private String username;

    public LivegoodsBuyMessage() {
    }

    public LivegoodsBuyMessage(String itemId, String username) {
        this.itemId = itemId;
        this.username = username;
    }

    @Override
    public String toString() {
        return "LivegoodsBuyMessage{" +
                "itemId='" + itemId + '\'' +
                ", username='" + username + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        LivegoodsBuyMessage that = (LivegoodsBuyMessage) o;
        return Objects.equals(itemId, that.itemId) && Objects.equals(username, that.username);
    }

    @Override
    public int hashCode() {
        return Objects.hash(itemId, username);
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }
}
